package datastructure.ch03_linked.ch07_nodes;

/**
 * 单节点
 *
 * @author guodd
 * @version 1.0 use jdk 1.8
 */
public class SingleNode<E> {
    public E element;
    public SingleNode<E> next;

    public SingleNode() {
    }

    public SingleNode(E element) {
        this(element, null);
    }

    public SingleNode(E element, SingleNode<E> next) {
        this.element = element;
        this.next = next;
    }

    @Override
    public String toString() {
        return element + "_" + (next != null ? next.element : "NULL");
    }
}
